package com.example.javaweb1.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;


public class User {
    @Getter
    @Setter
    private Integer id;
    @Getter
    @Setter
    @NotBlank(message = "不能为空")
    @Length(min = 2, max = 20, message = "长度要在2到20之间")
    private String username;
    @Getter
    @Setter
    @Length(min = 4, max = 8, message = "长度要在2到8之间")
    private String password;
    @Getter
    @Setter
    private Integer age;

}
